Skip to content

Deep object update consistency#3847

Merged
soyuka merged 2 commits into
api-platform:masterfrom
soyuka:fix/abstract-normalizer-constructor-2
Nov 30, 2020
Merged

Deep object update consistency#3847
soyuka merged 2 commits into
api-platform:masterfrom
soyuka:fix/abstract-normalizer-constructor-2

Conversation

@soyuka

@soyuka soyuka commented Nov 26, 2020

Copy link
Copy Markdown
Member
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets fixes #3087
License MIT
Doc PR Should add one for skip_null_values

This PR fixes inconsistencies when updating deep objects. In an update context, we should always set the deep_object_to_populate, at least for the application/merge-patch+json content type.
Note that this fixes incoherent behavior for PATCH when updating nested resources.

Also, now we support deep_object_to_populate and this fixes #3087. Users can enable it via the denormalization_context if needed.

Many thanks @Toflar for reporting this and helping me get to the bottom of this!

Comment thread tests/Fixtures/app/config/config_common.yml Outdated
Comment thread src/Serializer/SerializerContextBuilder.php
Comment thread tests/Fixtures/app/config/config_test.yml Outdated
Comment thread features/doctrine/json_document.feature Outdated
@soyuka
soyuka force-pushed the fix/abstract-normalizer-constructor-2 branch 6 times, most recently from f1b2e0f to 5db20d5 Compare November 26, 2020 12:45
Comment thread src/Serializer/SerializerContextBuilder.php Outdated
@soyuka
soyuka force-pushed the fix/abstract-normalizer-constructor-2 branch 3 times, most recently from 4f3a8ec to 8608271 Compare November 26, 2020 14:41
Comment thread features/main/patch.feature Outdated
Comment thread features/main/patch.feature
@soyuka
soyuka force-pushed the fix/abstract-normalizer-constructor-2 branch from 2a6e000 to 8f37049 Compare November 29, 2020 17:45
@soyuka
soyuka changed the base branch from 2.5 to master November 29, 2020 17:45
@soyuka
soyuka force-pushed the fix/abstract-normalizer-constructor-2 branch 2 times, most recently from 9775a97 to 3f25711 Compare November 29, 2020 20:02
@soyuka
soyuka force-pushed the fix/abstract-normalizer-constructor-2 branch from f953a0b to cb7cf2b Compare November 30, 2020 13:57
@soyuka
soyuka merged commit f3c544a into api-platform:master Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hardcoded parent constructor parameters on AbstractItemNormalizer

3 participants